AC_INIT([libpurple-microblog-sina], [0.1], [deanraccoon@gmail.com])
AC_PREREQ(2.60)
AM_INIT_AUTOMAKE(libpurple-microblog-sina, 0.1)

AC_PROG_CC
AM_PROG_CC_C_O

#only generate .so
AM_PROG_LIBTOOL
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)

AC_CONFIG_MACRO_DIR([m4])

#i18n



PKG_PROG_PKG_CONFIG()

PKG_CHECK_MODULES(PIDGIN, pidgin)
PKG_CHECK_MODULES(PURPLE,purple)
PKG_CHECK_MODULES(GLIB, glib-2.0)
AC_SUBST(PURPLE_CFLAGS)
AC_SUBST(PURPLE_LIBS)
AC_SUBST(PIDGIN_CFLAGS)
AC_SUBST(PIDGIN_LIBS)

PURPLE_LIBDIR=`pkg-config --variable=libdir purple`
PIDGIN_DATADIR=`pkg-config --variable=datadir pidgin`

AC_SUBST(PURPLE_LIBDIR)
AC_SUBST(PIDGIN_DATADIR)

#AC_SEARCH_LIBS([dlopen], [dl])

dnl Language Support
IT_PROG_INTLTOOL([0.35.0])
GETTEXT_PACKAGE=libpurple-microblog-sina-0.1
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
		                      [gettext package])
AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT

AC_CONFIG_FILES([Makefile po/Makefile.in])
AC_OUTPUT

echo "
	prefix:                 ${prefix}
	mandir:                 ${mandir}
	compiler:               ${CC}
	cflags:                 ${CFLAGS}
	ldflags:                ${LDFLAGS}
	PIDGIN_CFLAGS:          ${PIDGIN_CFLAGS}
	PIDGIN_LIBS:            ${PIDGIN_LIBS}
	PURPLE_CFLAGS:          ${PURPLE_CFLAGS}
	PURPLE_LIBS:            ${PURPLE_LIBS}
"
